package com.opgea.crm.web.modal;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import com.opgea.crm.common.constant.ApplicationConstant;
import com.opgea.crm.domain.entities.security.CrmUser;
import com.opgea.crm.services.security.CrmUserService;

public class LoggedUser {

	@Autowired
	CrmUserService userService;
	private CrmUser user;

	public static CrmUser getUser(HttpServletRequest request) {
		HttpSession session = request.getSession();
		CrmUser user = (CrmUser)session.getAttribute(ApplicationConstant.SESSION_USER);
		return user;
	}

	@Override
	public String toString() {
		return "LoggedUser [user=" + user + "]";
	}

	
}
